//
//  CertificationViewController.m
//  Futures
//
//  Created by Cheng on 2017/7/20.
//  Copyright © 2017年 Cheng. All rights reserved.
//

#import "CertificationViewController.h"
#import "LoginTextField.h"

@interface CertificationViewController ()<LoginTextFieldDelegate>

@property (weak, nonatomic) IBOutlet LoginTextField *nameView;
@property (weak, nonatomic) IBOutlet LoginTextField *identifierView;
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;

@end

@implementation CertificationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"实名认证";
    
    self.nameView.title.text = @"真实姓名";
    self.nameView.textField.placeholder = @"程*鑫";
    self.nameView.title.font = [UIFont systemFontOfSize:14];
    
    self.identifierView.title.text = @"身份证号";
    self.identifierView.textField.placeholder = @"421182********0230";
    self.identifierView.title.font = [UIFont systemFontOfSize:14];
    
//    [self addToolbarOnKeyboard:self.nameView.textField];
//    [self addToolbarOnKeyboard:self.identifierView.textField];
    
    self.nameView.delegate = self;
    self.identifierView.delegate = self;
    
    
}

- (void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    
    if (self.nextBtn) {
        self.nextBtn.enabled = NO;
        self.nextBtn.backgroundColor = UICOLOR_RGB_Alpha(0xCCCCCC, 1);
    }
    
    [self textDidChange:nil];
}

- (void)textDidChange:(NSString *)text{
    MYLog(@"textdidchange");
    if (self.nameView.textField.text.length*self.identifierView.textField.text.length) {
        self.nextBtn.enabled = YES;
        self.nextBtn.backgroundColor = COLOR_MAIN_GOLD;
    }else{
        self.nextBtn.enabled = NO;
        self.nextBtn.backgroundColor = UICOLOR_RGB_Alpha(0xCCCCCC, 1);
    }
}




@end
